package com.woniuxy.micromedicalserver.doctormanage.controller;

import com.woniuxy.micromedicalserver.bean.DoctorTitleBean;
import com.woniuxy.micromedicalserver.bean.ResultMsg;
import com.woniuxy.micromedicalserver.doctormanage.service.IDoctorTitleService;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping(value = "/doctor_title", produces = MediaType.APPLICATION_JSON_VALUE)
public class DoctorTitleController {

    @Resource
    private IDoctorTitleService doctorTitleServiceImpl;

    @GetMapping(value = "/{id}")
    public ResultMsg selectByID(@PathVariable("id") Byte ID){
        DoctorTitleBean doctorTitleBean = doctorTitleServiceImpl.selectByID(ID);
        return new ResultMsg(true,doctorTitleBean);
    }

    @GetMapping(value = "")
    public ResultMsg selectAll(){
        List<DoctorTitleBean> list = doctorTitleServiceImpl.selectAll();
        return new ResultMsg(true,list);
    }



}
